<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include/taglibs.jsp" %>
<html>
<head>
    <%@include file="/include/header.html" %>
    <script type="text/javascript" src="${ctx}/libjs/plugins/treeBox/treeBox.js"></script>
    <script type="text/javascript" src="${ctx}/appjs/fault/pileFaultRecord.js"></script>
    <link rel="stylesheet" href="${ctx}/statics/css/update.css?v=20200825">
    <link rel="stylesheet" href="${ctx}/statics/css/common.css?v=20200825">
    <link rel="stylesheet" href="${ctx}/libjs/plugins/laydate/laydate.css">
    <script src="${ctx}/libjs/plugins/laydate/laydate.js"></script>
    <link rel="stylesheet" href="${ctx}/libjs/plugins/bootstrap-table-pagejump/bootstrap-table-pagejump.css">
    <script src="${ctx}/libjs/plugins/bootstrap-table-pagejump/bootstrap-table-pagejump.js"></script>
    <link rel="stylesheet" href="${ctx}/libjs/plugins/bootStrap-table-fixed-column/bootstrap-table-fixed-columns.css">
    <script src="${ctx}/libjs/plugins/bootStrap-table-fixed-column/bootstrap-table-fixed-columns.js"></script>
    <style>
        .treeBox .tree-active:hover {
            /*background:#a84747;*/
            color: #fff !important;
        }

        .treeBox a {
            color: #000;
            text-align: center !important;
        }

        .tree-active {
            background: #1e9fff;
            color: #fff !important;
        }

        .treeBox .tree-active:hover {
            background: #1e9fff;
            color: #fff !important;
        }

        .treeBox label {
            text-align: center;
        }

        .bootstrap-table .fixed-table-container .table thead th .th-inner {
            text-align: center !important;
        }

        .fixed-table-body-columns1 {
            width: 203px !important;
        }

        .fixed-table-toolbar {
            display: block;
            /*top: 37px;*/
            right: 90px;
            position: absolute;
            z-index: 100000;
        }
    </style>
</head>

<script type="text/javascript">
    $('#topLink', window.parent.document).html(function (i, origText) {
        return '<ol class="breadcrumb">' +
            '<li class="breadcrumb-item">' +
            '<a href="">主页</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a>充电管理</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<strong>充电设备告警</strong>' +
            '</li>' +
            '</ol>';
    });

    var has_add = '';
    var has_edit = '';
    var has_delete = '';
    var StationManager_fault_update = false;
</script>

<body class="gray-bg pileFaultBody">
<div class="wrapper wrapper-content ">
    <div class="col-sm-12">
        <div class="ibox">
            <div class="ibox-body">
                <div class="row">
                    <select class="form-control shortInput input-distance" name="pileFaultCode" id="pileFaultCode">
                        <option value="">故障类型</option>
                        <c:forEach items="${pileFaults}" var="pileFaultInfo">
                            <option value="${pileFaultInfo.pileFaultCode}">${pileFaultInfo.pileFaultType}</option>
                        </c:forEach>
                    </select>
                    <select type="text" class="form-control shortInput input-distance" name="status"
                            id="status">
                        <option value="">处理状态</option>
                        <option value="0">待处理</option>
                        <option value="1">已处理</option>
                    </select>
                    <input id="startTime" name="startTime" type="text"
                           class="form-control layer-date input-distance timeInput"
                           placeholder="开始时间">
                    <input id="endTime" name="endTime" type="text"
                           class="form-control layer-date input-distance timeInput"
                           placeholder="结束时间">
                    <button class="btn btn-success input-distance" onclick="pileFaultRecord.reLoad()">查询</button>
                    <div class="pull-left search fr">
                        <button class="btn btn-success input-distance exportBtn" onclick="pileFaultRecord.exportPileFault()">导出</button>
                    </div>
                </div>
              <%--  <div class="pull-left search col-md-2">
                </div>--%>
                <table id="exampleTable" data-mobile-responsive="true">
                </table>
            </div>
        </div>
    </div>
</div>
<shiro:hasPermission name="StationManager_fault_update">
    <script>
        StationManager_fault_update = true;
    </script>
</shiro:hasPermission>


<script type="text/javascript">

    function dealBtn() {
        var pileFaultRecordId = $("#dealId").val();
        setTimeout(function () {
            layer.open({
                type: 1,
                title: '故障处理',
                closeBtn: false,
                area: '300px;',
                shade: 0.8,
                maxWidth: '622px',
                shadeClose: true,
                content: ' <div class="row"><label>问题说明</label>'+
                    '<input id="remark"  type="text" class="form-control longInput input-distance"></div>',
                btn: ['确认','取消'],
                btn1: function (index) {//layer.msg('yes');    //取消
                    var remark = $("#remark").val();
                    $.ajax({
                        "url": jsctx + "/pileFaultRecord/dealRemark",
                        "method": "POST",
                        "data": {
                            pileFaultRecordId:pileFaultRecordId,
                            remark:remark
                        },
                        "success": function (data) {
                            if (data.status == 200) {
                                layer.msg("处理成功");
                                layer.close(index);
                            } else {
                                layer.msg("处理失败");
                                return false;
                            }
                        }
                    });

                },
                btn2: function (index) {//layer.msg('yes');    //取消
                    layer.close(index)
                },

            });
        }, 100)

    }
    // //日期范围限制
    var start = {
        elem: '#startTime',
        format: 'YYYY-MM-DD hh:mm:ss',
        // theme: '#3195f0',
        // min: laydate.now(), //设定最小日期为当前日期
        // max: '2099-06-16 23:59:59', //最大日期
        istime: true,
        istoday: false,
        choose: function (datas) {
            $("#endTime").val("")
            end.min = datas
        }
    };
    var end = {
        elem: '#endTime',
        format: 'YYYY-MM-DD hh:mm:ss',
        // theme: '#3195f0',
        // min: laydate.now(),
        // max: '2099-06-16 23:59:59',
        istime: true,
        istoday: false,
        choose: function (datas) {
            start.max = datas; //结束日选好后，重置开始日的最大日期
        }
    };
    laydate(start);
    laydate(end);
    laydate.skin('molv');//皮肤
    pileFaultRecord.init();
</script>
</body>
</html>
